package com.aw.guiguzi.module.setting

import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import com.aw.baselib.base.AwBaseActivity
import com.aw.baselib.base.AwBaseBindingActivity
import com.aw.baselib.util.AwDataUtil
import com.aw.baselib.util.AwFileUtil
import com.aw.guiguzi.R
import com.aw.guiguzi.databinding.ActivitySettingLocalCacheBinding
import com.aw.guiguzi.util.MyFileUtil.fileUrl

class LocalCacheActivity : AwBaseBindingActivity<ActivitySettingLocalCacheBinding>() {
    override fun getViewBinding(): ActivitySettingLocalCacheBinding {
        return ActivitySettingLocalCacheBinding.inflate(mActivity.layoutInflater)
    }

    override fun initView() {
        super.initView()
        //        tv_content.setMovementMethod(ScrollingMovementMethod.getInstance());
        setToolbar("本日数据", null)
    }

    override fun initData() {
        super.initData()
        val content = AwFileUtil.readFileOnLine(fileUrl)
        if (!AwDataUtil.isEmpty(content)) {
            showView(binding.llContent, true)
            showView(binding.viewNoData, false)
            setText(binding.tvContent, content)
        } else {
            showView(binding.llContent, false)
            showView(binding.viewNoData, true)
        }
    }

    override fun initListener() {
        super.initListener()
    }
}